module TopKeyBeep (
        input      clk,
        input      rst_n,
        input      key_in,
        output     beep
    );
    parameter DEBOUNCE_TIME = 32'd1_000_000;

    wire key_out;

    // 需要消抖的时间,单位为时钟周期,50Mhz时钟下20ms约等于1_000_000个周期
    KeyDebounce #(
                    .DEBOUNCE_TIME(DEBOUNCE_TIME)
                ) u_KeyDebounce (
                    .clk(clk),
                    .rst_n(rst_n),
                    .key_in(key_in),
                    .key_out(key_out)
                );

    StableKeyClick u_StableKeyClick (
                       .clk(clk),
                       .rst_n(rst_n),
                       .key_in(key_out),
                       .beep(beep)
                   );

endmodule
